package com.wzqj.agent.web.demo.service.impl;

import com.wzqj.agent.web.demo.dao.UserInfoDao;
import com.wzqj.agent.web.demo.domain.UserInfo;
import com.wzqj.agent.web.demo.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 创建时间：2015-7-27 下午1:17:27
 * @author wh
 * @version 2.2
 */
@Service("userInfoService")
public class UserServiceImpl implements UserService {

	@Autowired
	private UserInfoDao userInfoDao;

	@Override
	public UserInfo getUserById(int id) {
		return userInfoDao.selectByPrimaryKey(id);
	}

	@Override
	public List<UserInfo> getUsers() {
		return userInfoDao.selectAll();
	}

	@Override
	public int insert(UserInfo userInfo) {
		
		int result = userInfoDao.insert(userInfo);
		
		System.out.println(result);
		return result;
	}

}
